public class SearchNode {
	private CostedPath identifier;				// This is a list of nodes in the path
	private int g;								// The path cost, given as the total food quanta consumed in reaching the final node in the path
												// Lower values for g are better, if (g <= 0 || (g == 0 && finalNode != TREASURE)) the path is invalid
	private int h;								// The estimated cost to get to the treasure cave
												// Lower values for h are better
	// f = g + h								// The total estimated path cost after reaching the treasure cave
												// Lower values for f are better, if f < 0 the path is invalid
	
	public SearchNode(CostedPath identifier, int h) {
		this.identifier = identifier;
		this.g = this.identifier.getCost();
		this.h = h;
	}
	
	public CostedPath getIdentifier() {
		return this.identifier;
	}
	
	public int getG() {
		return this.g;
	}
	
	public int getH() {
		return this.h;
	}
	
	public int getF() {
		return this.identifier.getCost() + this.h;
	}
	
	public boolean isSolution() {
		return this.identifier.path.get(this.identifier.path.size() - 1).getType() == MazeNode.Type.TREASURE;
	}
	
	public void displayNode() {
		System.out.println(identifier.path.toString() + "\n" + 
							"\tg = " + this.g + "\n" + 
							"\th = " + this.getH() + "\n" +
							"\tf = " + this.getF());
	}
}
